package org.thanos.simulator.util;


import org.thanos.bacnet.type.constructed.ObjectTypesSupported;
import org.thanos.bacnet.type.constructed.ServicesSupported;
import org.thanos.bacnet.type.enumerated.ObjectType;

import java.util.Arrays;
import java.util.List;

public class PropertyUtil {

    public static List<ObjectType> analogTypes(){
        return Arrays.asList(ObjectType.analogInput, ObjectType.analogOutput, ObjectType.analogValue);
    }

    public static List<ObjectType> binaryTypes(){
        return Arrays.asList(ObjectType.binaryInput, ObjectType.binaryOutput, ObjectType.binaryValue);
    }

    public static List<ObjectType> multiStateTypes(){
        return Arrays.asList(ObjectType.multiStateInput, ObjectType.multiStateOutput, ObjectType.multiStateValue);
    }

    public static List<ObjectType> supportedObjectType() {
        return Arrays.asList(ObjectType.analogInput, ObjectType.analogOutput, ObjectType.analogValue,
                ObjectType.binaryInput, ObjectType.binaryOutput, ObjectType.binaryValue,
                ObjectType.multiStateInput, ObjectType.multiStateOutput, ObjectType.multiStateValue
        );
    }

    public static ServicesSupported buildServicesSupported() {
        final ServicesSupported servicesSupported = new ServicesSupported();
        servicesSupported.setAcknowledgeAlarm(true);
        servicesSupported.setConfirmedCovNotification(true);
        servicesSupported.setConfirmedEventNotification(true);
        servicesSupported.setGetAlarmSummary(false);
        servicesSupported.setGetEnrollmentSummary(true);
        servicesSupported.setSubscribeCov(true);
        servicesSupported.setAtomicReadFile(false);
        servicesSupported.setAtomicWriteFile(false);
        servicesSupported.setAddListElement(false);
        servicesSupported.setRemoveListElement(false);
        servicesSupported.setCreateObject(false);
        servicesSupported.setDeleteObject(false);
        servicesSupported.setReadProperty(true);
        servicesSupported.setReadPropertyMultiple(true);
        servicesSupported.setWriteProperty(true);
        servicesSupported.setWritePropertyMultiple(true);
        servicesSupported.setDeviceCommunicationControl(false);
        servicesSupported.setConfirmedPrivateTransfer(false);
        servicesSupported.setConfirmedTextMessage(false);
        servicesSupported.setReinitializeDevice(true);
        servicesSupported.setVtOpen(false);
        servicesSupported.setVtClose(false);
        servicesSupported.setVtData(false);
        servicesSupported.setIAm(true);
        servicesSupported.setIHave(true);
        servicesSupported.setUnconfirmedCovNotification(true);
        servicesSupported.setUnconfirmedEventNotification(true);
        servicesSupported.setUnconfirmedPrivateTransfer(false);
        servicesSupported.setUnconfirmedTextMessage(false);
        servicesSupported.setTimeSynchronization(true);
        servicesSupported.setWhoHas(true);
        servicesSupported.setWhoIs(true);
        servicesSupported.setReadRange(true);
        servicesSupported.setUtcTimeSynchronization(true);
        servicesSupported.setLifeSafetyOperation(false);
        servicesSupported.setSubscribeCovProperty(false);
        servicesSupported.setGetEventInformation(true);
        servicesSupported.setWriteGroup(false);
        servicesSupported.setSubscribeCovPropertyMultiple(false);
        servicesSupported.setConfirmedCovNotificationMultiple(true);
        servicesSupported.setUnconfirmedCovNotificationMultiple(true);
        return servicesSupported;
    }

    public static ObjectTypesSupported buildObjectTypesSupported() {
        final ObjectTypesSupported objectTypesSupported = new ObjectTypesSupported();
        objectTypesSupported.set(ObjectType.analogInput, true);
        objectTypesSupported.set(ObjectType.analogOutput, true);
        objectTypesSupported.set(ObjectType.analogValue, true);
        objectTypesSupported.set(ObjectType.binaryInput, true);
        objectTypesSupported.set(ObjectType.binaryOutput, true);
        objectTypesSupported.set(ObjectType.binaryValue, true);
        objectTypesSupported.set(ObjectType.calendar, false);
        objectTypesSupported.set(ObjectType.command, false);
        objectTypesSupported.set(ObjectType.device, true);
        objectTypesSupported.set(ObjectType.eventEnrollment, false);
        objectTypesSupported.set(ObjectType.file, false);
        objectTypesSupported.set(ObjectType.group, false);
        objectTypesSupported.set(ObjectType.loop, false);
        objectTypesSupported.set(ObjectType.multiStateInput, true);
        objectTypesSupported.set(ObjectType.multiStateOutput, true);
        objectTypesSupported.set(ObjectType.notificationClass, true);
        objectTypesSupported.set(ObjectType.program, false);
        objectTypesSupported.set(ObjectType.schedule, false);
        objectTypesSupported.set(ObjectType.averaging, false);
        objectTypesSupported.set(ObjectType.multiStateValue, false);
        objectTypesSupported.set(ObjectType.trendLog, false);
        objectTypesSupported.set(ObjectType.lifeSafetyPoint, false);
        objectTypesSupported.set(ObjectType.lifeSafetyZone, false);
        objectTypesSupported.set(ObjectType.accumulator, false);
        objectTypesSupported.set(ObjectType.pulseConverter, false);
        objectTypesSupported.set(ObjectType.eventLog, false);
        objectTypesSupported.set(ObjectType.globalGroup, false);
        objectTypesSupported.set(ObjectType.trendLogMultiple, false);
        objectTypesSupported.set(ObjectType.loadControl, false);
        objectTypesSupported.set(ObjectType.structuredView, false);
        objectTypesSupported.set(ObjectType.accessDoor, false);
        objectTypesSupported.set(ObjectType.timer, false);
        objectTypesSupported.set(ObjectType.accessCredential, false);
        objectTypesSupported.set(ObjectType.accessPoint, false);
        objectTypesSupported.set(ObjectType.accessRights, false);
        objectTypesSupported.set(ObjectType.accessUser, false);
        objectTypesSupported.set(ObjectType.accessZone, false);
        objectTypesSupported.set(ObjectType.credentialDataInput, false);
        objectTypesSupported.set(ObjectType.networkSecurity, false);
        objectTypesSupported.set(ObjectType.bitstringValue, false);
        objectTypesSupported.set(ObjectType.characterstringValue, false);
        objectTypesSupported.set(ObjectType.datePatternValue, false);
        objectTypesSupported.set(ObjectType.dateValue, false);
        objectTypesSupported.set(ObjectType.datetimePatternValue, false);
        objectTypesSupported.set(ObjectType.datetimeValue, false);
        objectTypesSupported.set(ObjectType.integerValue, false);
        objectTypesSupported.set(ObjectType.largeAnalogValue, false);
        objectTypesSupported.set(ObjectType.octetstringValue, false);
        objectTypesSupported.set(ObjectType.positiveIntegerValue, false);
        objectTypesSupported.set(ObjectType.timePatternValue, false);
        objectTypesSupported.set(ObjectType.timeValue, false);
        objectTypesSupported.set(ObjectType.notificationForwarder, false);
        objectTypesSupported.set(ObjectType.alertEnrollment, false);
        objectTypesSupported.set(ObjectType.channel, false);
        objectTypesSupported.set(ObjectType.lightingOutput, false);
        objectTypesSupported.set(ObjectType.binaryLightingOutput, false);
        objectTypesSupported.set(ObjectType.networkPort, false);
        objectTypesSupported.set(ObjectType.elevatorGroup, false);
        objectTypesSupported.set(ObjectType.escalator, false);
        objectTypesSupported.set(ObjectType.lift, false);
        return objectTypesSupported;
    }

}
